<template>
	<view class="u-p-28 ">
		<u-parse :html="content"></u-parse>
	</view>
</template>

<script>
	import {
		getConfig
	} from '@/api/user';
	export default {
		data() {
			return {
				content: '',
				name: '',
			};
		},
		onLoad(options) {
			const obj = {
				platform_rule: '平台规则',
				adopt_agreement: "领养协议",
				communication_group: "领养救助交流群",
				contact_volunteer: "联系义工",
				wechat_qrcode: "公众号二维码",
			}
			this.name = options.name;
			uni.setNavigationBarTitle({
				title: obj[this.name]
			})
		},
		mounted() {
			this.getConfig();
		},
		methods: {
			async getConfig() {
				const res = await getConfig({
					name: this.name
				});
				const data = res.data;
				this.content = data.replace(/<img/g, '<img style="max-width:100%;height:auto;display:block;"');
			}
		}
	}
</script>
